<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/commons.jsp"%>

<form id="pagerForm" method="post" action="sys/users/list.action">
	<input type="hidden" name="pageNum" value="${pageNum}" />
	<input type="hidden" name="numPerPage" value="${numPerPage}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
	<input type="hidden" name="orderDirection" value="${param.orderDirection}" />
	
	<input type="hidden" name="user.userName" value="${user.userName}"/>
	<input type="hidden" name="user.isLock" value="${user.isLock}"/>
	<input type="hidden" name="user.loginName" value="${user.loginName}"/>
</form>

<form method="post" action="sys/users/list.action" onsubmit="return navTabSearch(this)">
	
	<div class="pageHeader">
		<div class="searchBar">
			<ul class="searchContent">
				<li>
					<label>用户名：</label>
					<input type="text" name="user.userName" value="${user.userName}"/>
				</li>
				<li>
					<label>登陆名：</label>
					<input type="text" name="user.loginName" value="${user.loginName}"/>
				</li>
				<li>
					<label>状态：</label>
					<select name="user.isLock">
						<option value="">全部</option>
						<option value="0" ${'0' eq user.isLock ? 'selected="selected"' : ''}>正常</option>
						<option value="1" ${'1' eq user.isLock ? 'selected="selected"' : ''}>锁定</option>
					</select>
				</li>
			</ul>
			<div class="subBar">
				<ul>						
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">搜索</button></div></div></li>
					<li><a class="button" href="/management/user!advancedSearch.do?userType=TRAINING" target="dialog" title="Advanced Search"><span>高级搜索</span></a></li>
				</ul>
			</div>
		</div>
	</div>
</form>

<div class="pageContent">

	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" target="navTab" rel="userAddNav" href="sys/users/add.action?op=add" title="新建用户"><span>新建</span></a></li>
			<li><a class="edit" target="navTab" rel="userEditNav" href="sys/users/add.action?op=modify&user.id={slt_uid}" warn="请选择一个用户"><span>修改</span></a></li>
			<li><a class="delete" target="ajaxTodo" href="sys/users/delete.action?user.id={slt_uid}" title="确定要删除吗?" warn="请选择一个用户"><span>删除</span></a></li>
			<li class="line">line</li>
			<li><a class="icon" href="javascript:void(0);" target="dwzImport" targetType="navTab"><span>导入</span></a></li>
			<li><a class="icon" href="/management/user!export.do" target="dwzExport" targetType="navTab" title="确定要导出?"><span>导出</span></a></li>
		</ul>
	</div>
	
	<table class="table" layoutH="138" width="100%">
		<thead>
			<tr>
				<th width="100" orderField="userName" class="${param.orderField eq 'userName' ? param.orderDirection : ''}">用户名</th>
				<th width="80" orderField="loginName" class="${param.orderField eq 'loginName' ? param.orderDirection : ''}">登录名</th>
				<th width="80" orderField="email" class="${param.orderField eq 'email' ? param.orderDirection : ''}">电子邮件</th>
				<th width="100" class="">所属部门</th>
				<th width="90" orderField="isLock" class="${param.orderField eq 'isLock' ? param.orderDirection : ''}">用户状态</th>
				<th width="90" orderField="userOrd" class="${param.orderField eq 'userOrd' ? param.orderDirection : ''}">用户排序</th>
				<th width="80" orderField="createTime" class="${param.orderField eq 'createTime' ? param.orderDirection : ''}">创建时间</th>
				<th width="100">编辑</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="item" items="${userList}">
			<tr target="slt_uid" rel="${item.id}">
				<td><a href="sys/users/view.action?user.id=${item.id}" rel="userViewNav" title="查看用户" target="navTab">${item.userName}</a></td>
				<td><a href="sys/users/view.action?user.id=${item.id}" rel="userViewNav" title="查看用户" target="navTab">${item.loginName}</a></td>
				<td>${item.email}</td>
				<td>
				<c:forEach items="${item.depts}" var="t" varStatus="s">
					<c:if test="${s.index>0}">,</c:if><a href="sys/depts/view.action?dept.deptId=${t.deptId}" rel="deptViewNav" title="部门详情" target="navTab">${t.deptName}</a>
				</c:forEach>
				</td>
				<td>
				<c:choose>
					<c:when test="${item.isLock==0}">正常</c:when>
					<c:otherwise>锁定</c:otherwise>
				</c:choose>
				</td>
				<td>${item.userOrd}</td>
				<td><fmt:formatDate pattern="yyyy-MM-dd HH:mm" value="${item.createTime}"/></td>
				<td></td>
			</tr>
			</c:forEach>
			<c:if test="${empty userList || fn:length(userList)==0}">
				<tr><td colspan="6"><div style="color: red;margin-left: 12px;">提示：暂无数据</div></td></tr>
			</c:if>
		</tbody>
	</table>
	
	<!-- 分页 -->
	<c:import url="/commons/pager/panelBar.jsp"></c:import>
	
</div>


